package com.ck.dao;

import com.ck.model.common.PollConfig;
import org.apache.ibatis.annotations.*;

public interface PollConfigMapper {
    @Delete({
        "delete from ck_poll_config",
        "where poll_config_id = #{pollConfigId,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long pollConfigId);

    @Insert({
        "insert into ck_poll_config (poll_config_id, poll_name, ",
        "poll_interval_time)",
        "values (#{pollConfigId,jdbcType=BIGINT}, #{pollName,jdbcType=VARCHAR}, ",
        "#{pollIntervalTime,jdbcType=INTEGER})"
    })
    int insert(PollConfig record);

    int insertSelective(PollConfig record);

    @Select({
        "select",
        "poll_config_id, poll_name, poll_interval_time",
        "from ck_poll_config",
        "where poll_config_id = #{pollConfigId,jdbcType=BIGINT}"
    })
    PollConfig selectByPrimaryKey(Long pollConfigId);

    int updateByPrimaryKeySelective(PollConfig record);

    @Update({
        "update ck_poll_config",
        "set poll_name = #{pollName,jdbcType=VARCHAR},",
          "poll_interval_time = #{pollIntervalTime,jdbcType=INTEGER}",
        "where poll_config_id = #{pollConfigId,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(PollConfig record);
}